﻿<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
    exclude-result-prefixes="msxsl"
    xmlns:dt="urn:schemas-microsoft-com:datatypes">
  <xsl:output version="4.0" method="html" indent="no"  omit-xml-declaration="yes" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
   <xsl:template match="//Patients">
     <div id="patientlistcontainer">
     <table class="patientlist selectable defaultpointer defaultcolour">
       <tbody>
        <xsl:for-each select="PatientListCareProcessStatusResponse">

          <xsl:variable name="hospitalnumber" select="Patient/identifierValue[domainForIdentifier/domainName='HospitalNumber']/identifier"/>
          <tr class="clearfix roundedcorners">
          <td class="clearfix">
            <div class="floatleft bold">
              <xsl:value-of select="PatientName/familyName"/>,&#160;<xsl:value-of select="PatientName/givenNames"/>
              <div class="hiddesnbydefault clearall details">
                <b>Health Service Speciality: </b>
                <xsl:value-of select="HealthService/healthServiceSpeciality"/>
              </div>
            </div>
            <div class="details floatright">
              <b>DOB: </b><xsl:value-of select="dob/dateOfBirth/timepoint"/>
              <br/>
              <b>PAS: </b><xsl:value-of select="$hospitalnumber"/>,&#160;<b>NHS: ???</b>
            </div>
            <div class="patientselectoptions clearfix">
              <ul class="clearfix">
                <li>
                  <a href="/Home/DocumentsPage?subjectIdentifiers=HospitalNumber,{$hospitalnumber}" >Documents</a>
                </li>
                <li>Medicines</li>
                <li>Test Requesting</li>
                <li>Patient Record</li>
              </ul>
            </div>
        </td>
        </tr>
      </xsl:for-each>
       </tbody>
    </table>
     </div>
  </xsl:template>
</xsl:stylesheet>
